package com.xyh.transaction.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xyh.transaction.common.Constant;
import com.xyh.transaction.common.OrderDeliveryType;
import com.xyh.transaction.common.OrderPayType;
import com.xyh.transaction.common.OrderStatus;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Order extends BaseEntity implements Serializable {

    private static final long serialVersionUID = -7671756385477179547L;

    private String orderNo;

    private BigDecimal amount;

    private OrderStatus status;

    private Integer addressId;

    private OrderDeliveryType deliveryType;

    private OrderPayType payType;

    private Integer sellerId;

    @JsonFormat(pattern = Constant.DATE_FORMAT_DEFAULT)
    private LocalDateTime payTime; // 付款时间

    @JsonFormat(pattern = Constant.DATE_FORMAT_DEFAULT)
    private LocalDateTime deliveryTime;// 送货时间

    @JsonFormat(pattern = Constant.DATE_FORMAT_DEFAULT)
    private LocalDateTime confirmTime;// 收货时间

    @JsonFormat(pattern = Constant.DATE_FORMAT_DEFAULT)
    private LocalDateTime evaluateTime; // 评价时间

    @JsonFormat(pattern = Constant.DATE_FORMAT_DEFAULT)
    private LocalDateTime completeTime;// 完成时间
}
